package com.xbongbong.saas.enums;

import lombok.Getter;

/**
 * 外链设置类型枚举1 权限 2 显示 3 外观 4 高级 5 筛选
 */
@Getter
public enum OutLinkSettingTypeEnum {

    PERMISSION_SETTING(1,"权限"),

    DISPLAY_SETTING(2,"显示"),

    APPEARANCE_SETTING(3,"外观"),

    ADVANCED_SETTING(4,"高级"),

    FILTER_SETTING(5,"筛选"),
    ;

    /**
     * 设置类型标识
     */
    private Integer code;
    /**
     * 设置类型名字
     */
    private String name;

    OutLinkSettingTypeEnum(Integer code,String name) {
      this.code = code;
      this.name = name;
    }

    public static OutLinkSettingTypeEnum getByCode(Integer code) {
        for (OutLinkSettingTypeEnum cacheCode : values()) {
            if (cacheCode.getCode().equals(code)) {
                return cacheCode;
            }
        }
        return null;
    }
}
